﻿create procedure [dbo].[usp_LogEntryUpdate] 
	@LogEntryId int
	, @ConcurrencyId rowversion
	, @PublicationId uniqueidentifier
	, @AppDomainId int
	, @AssemblyId int
	, @MachineId int
	, @IIdentityId int
	, @ProcessId int
	, @ThreadId int
	, @WorkItemId int
	, @LogEntry nvarchar(max) 
	, @Priority int
	, @Type int
	, @SerializedDictionaryXml xml
	, @XElement xml 
as

begin try
	
	begin transaction
	
		update [dbo].[LogEntry]
		set
			[PublicationId] = @PublicationId
			, [AppDomainId] = @AppDomainId
			, [AssemblyId] = @AssemblyId
			, [MachineId] = @MachineId
			, [IIdentityId] = @IIdentityId
			, [ProcessId] = @ProcessId
			, [ThreadId] = @ThreadId
			, [WorkItemId] = @WorkItemId
			, [LogEntry] = @LogEntry
			, [Priority] = @Priority
			, [Type] = @Type
			, [SerializedDictionaryXml] = @SerializedDictionaryXml			
			, [XElement] = @XElement
		where [LogEntryId] = @LogEntryId and [ConcurrencyId] = @ConcurrencyId
		
	commit transaction

end try
	
begin catch
	if @@trancount > 0
	begin
		rollback transaction;
	end
	execute [dbo].[usp_SqlErrorInsert]
end catch